﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteNew.Master" Inherits="System.Web.Mvc.ViewPage<ASPNETMVCApplication.Areas.Shop.Models.OrderModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Tìm hóa đơn khách hàng
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script>
    $(function () {
        $("button, input:submit,input:text,.details").button();

    });
	</script>
<script>
    $(function () {
        $("#DateFrom").datepicker(
        {
            changeMonth: true,
            changeYear: true,
            showOn: "button",
            buttonImage: "/Assets/images/calendar.gif",
            buttonImageOnly: true
        }
        );
    });
	</script>
    <script>
        $(function () {
            $("#DateThru").datepicker(
            {
                changeMonth: true,
                changeYear: true,
                showOn: "button",
                buttonImage: "/Assets/images/calendar.gif",
                buttonImageOnly: true
            }
            );
        });
	</script>
    <script type="text/javascript">
        $('form').submit();
        </script>
   <div id="page-heading"><h1>Tìm đơn hàng</h1></div>
<% Html.EnableClientValidation(); %>
  <% using (Html.BeginForm("SearchOrder", "Supplier", FormMethod.Post))
       {%>
        <%: Html.ValidationSummary(true) %> 
    
    
    <div id="page-heading" class="ui-state-default">
        <table style="width: 70%;">
        <tr>
            <td style="width: 200px" >
                &nbsp;
            <strong>Từ ngày</strong></td>
            <td style="width: 200px">
	<strong>Đến ngày
	</strong></td>
            
            <td>
                <strong>Chọn khách hàng</strong></td>
            <td><strong>Chọn Hóa Đơn</strong></td>
            <td rowspan="2">
               
            </td>
        </tr>
        <tr>
            <td style="width: 174px" >
               <%: Html.TextBoxFor(model => model.DateFrom) %>
            </td>
            <td style="width: 174px">
                <%: Html.TextBoxFor(model => model.DateThru) %></td>
           
            <td>
            <script type="text/javascript">
                function showCustomer(str) {
                    var xmlhttp;
                    if (str == "") {
                        document.getElementById("listCust").innerHTML = "";
                        return;
                    }
                    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                        xmlhttp = new XMLHttpRequest();
                    }
                    else {// code for IE6, IE5
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    xmlhttp.onreadystatechange = function () {
                        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                            document.getElementById("listCust").innerHTML = xmlhttp.responseText;
                        }
                    }
                    xmlhttp.open("GET", "GetCustByStatus/" + str, true);
                    xmlhttp.send();
                }
        </script>
                <div id="listCust"><%: Html.DropDownList("CustomerId", (IEnumerable<SelectListItem>)ViewData["ListCust"])%></div>
               </td>
            <td><%: Html.DropDownList("Status", (IEnumerable<SelectListItem>)ViewData["Status"], new { onchange = "showCustomer(this.value)" })%></td>
            <td> 
            <input  type="submit" value="Tìm kiếm"></td>
        </tr>
        
    </table>
    </div>
  

    <% } %>

  <!--Hien thi ket qua tim kiem-->

  <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="/Assets/Images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="/Assets/Images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
                <% Html.RenderPartial("ListOrderSupplier"); %>
			</div>
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>

 


</asp:Content>


